package com.freemaster.controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.freemaster.service.TestService;
import com.freemaster.util.CacheUtil;

@Controller
@RequestMapping("/test")
public class TestController {

	Logger logger =LoggerFactory.getLogger(TestController.class) ;
	
	@Resource
	TestService testService;
	
	
	@RequestMapping("ts")
	public void test(HttpServletRequest request ,HttpServletResponse response){
		logger.info("TestController--->ts"); 
		
		List<Map<String,Object>> list =testService.findAll("1");
		//System.out.println("list:"+list);
		
		String s =(String) CacheUtil.get("ss");
		if(s == null){
			CacheUtil.put("ss", "-----------spring Cache");
		}
		
		logger.info("list:"+list);
		
		logger.info("cache -->s:"+s);
		 
	}
}
